Xend will do a hypercall to destory domain when creating VTI guest fails.
If "is_vti" is not set at that point, HV will call relinquish_vcpu_resource(),
which is for non-VTI. It may try to free a NULL pointer, so dom0 crash.
This patch fix it.
Signed-off-by: Xu Anthony <Anthony.xu@intel.com>
Signed-off-by: Zhang Xin <xing.z.zhang@intel.com>
void
pervcpu_vhpt_free(struct vcpu *v)
{
- free_domheap_pages(v->arch.vhpt_page, VHPT_SIZE_LOG2 - PAGE_SHIFT);
+ if (likely(v->arch.vhpt_page != NULL))
+ free_domheap_pages(v->arch.vhpt_page,
+ VHPT_SIZE_LOG2 - PAGE_SHIFT);
}
#endif